# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: leon

currency_list = [
    # wget -qO - https://api.fcoin.com/v2/public/currencies
    '3db',
    '777',
    'aaa',
    'ae',
    'aidoc',
    'ait',
    'arp',
    'at',
    'banca',
    'bch',
    'beauty',
    'biz',
    'blz',
    'bnb',
    'brm',
    'btc',
    'btm',
    'but',
    'cbr',
    'ccc',
    'cccx',
    'cit',
    'cofi',
    'cps',
    'dag',
    'dagt',
    'datx',
    'dcc',
    'drct',
    'drink',
    'dta',
    'dws',
    'edu',
    'ees',
    'ejoy',
    'etc',
    'eth',
    'fair',
    'fbc',
    'fi',
    'fota',
    'fres',
    'ft',
    'ft_frozen',
    'fuel',
    'gene',
    'gram',
    'gtc',
    'gus',
    'hpc',
    'icc',
    'icx',
    'ifood',
    'iht',
    'iic',
    'ionc',
    'iov',
    'jac',
    'latx',
    'let',
    'lovc',
    'ltc',
    'lxt',
    'maya',
    'mdt',
    'mesh',
    'mof',
    'msc',
    'mst',
    'nc',
    'ngot',
    'oas',
    'ocn',
    'omg',
    'pai',
    'pmd',
    'pra',
    'rct',
    'rte',
    'scl',
    'sda',
    'sec',
    'sgcc',
    'show',
    'soc',
    'sss',
    'tbcoin',
    'tct',
    'tkt',
    'tos',
    'tst',
    'usdt',
    'vct',
    'vns',
    'wte',
    'xmx',
    'xps',
    'xrp',
    'yee',
    'zil',
    'zip',
    'zrx',
    'zsc',
]

# wget -qO - https://api.huobi.pro/v1/common/symbols | python -c 'import sys, json; x = json.load(sys.stdin); l = ["%s%s" % (e["base-currency"], e["quote-currency"]) for e in x["data"]]; import pprint; pprint.pprint(sorted(l));'
symbol_list = [
    '3dbeth',
    '777eth',
    'aaaeth',
    'aeeth',
    'aidoceth',
    'aiteth',
    'arpeth',
    'ateth',
    'bancaeth',
    'bchusdt',
    'bizeth',
    'blzeth',
    'bnbusdt',
    'brmeth',
    'btcusdt',
    'btmusdt',
    'buteth',
    'cbreth',
    'cccxeth',
    'citeth',
    'cofieth',
    'dageth',
    'datxeth',
    'dcceth',
    'drcteth',
    'dwseth',
    'eeseth',
    'ejoyeth',
    'etcusdt',
    'ethusdt',
    'faireth',
    'fieth',
    'fiusdt',
    'fotaeth',
    'freseth',
    'ftbtc',
    'fteth',
    'ftusdt',
    'grameth',
    'gtceth',
    'guseth',
    'hpceth',
    'icceth',
    'icxeth',
    'ifoodeth',
    'ihteth',
    'iiceth',
    'ionceth',
    'ioveth',
    'leteth',
    'ltcusdt',
    'mdteth',
    'mesheth',
    'nceth',
    'ngoteth',
    'oaseth',
    'ocneth',
    'omgeth',
    'paieth',
    'pmdeth',
    'praeth',
    'rcteth',
    'rteeth',
    'sdaeth',
    'sgcceth',
    'showeth',
    'soceth',
    'ssseth',
    'tcteth',
    'tkteth',
    'tsteth',
    'vcteth',
    'wteeth',
    'xmxeth',
    'xpseth',
    'xrpusdt',
    'yeeeth',
    'zileth',
    'zipeth',
    'zipusdt',
    'zrxeth',
]

quote_currency_list = [
    'eth',
    'usdt',
    'btc',
]

active_symbol_list = [
    'btcusdt',
    'ethusdt',
    'bchusdt',
    'ltcusdt',
    'etcusdt',
    'xrpusdt',
    'ftusdt',
    'fteth',
    'ftbtc',
    'fiusdt',
    'zipusdt',
]

# Can be queried from https://api.fcoin.com/v2/public/symbols
# wget -qO - https://api.fcoin.com/v2/public/symbols | python -c 'import sys, json; x = json.load(sys.stdin); d = {e["name"]:(e["price_decimal"], e["amount_decimal"]) for e in x["data"]}; import pprint; pprint.pprint(d);'
product_precision = {  # key is native_symbol, value is (price_precision, qty_precision)
    '3dbeth': (8, 2),
    '777eth': (8, 2),
    'aaaeth': (8, 2),
    'aeeth': (6, 2),
    'aidoceth': (8, 2),
    'aiteth': (8, 2),
    'arpeth': (8, 2),
    'ateth': (8, 2),
    'bancaeth': (8, 2),
    'bchusdt': (2, 4),
    'bizeth': (8, 2),
    'blzeth': (8, 2),
    'bnbusdt': (4, 2),
    'boceth': (8, 2),
    'brmeth': (8, 2),
    'btcusdt': (2, 4),
    'btmusdt': (4, 2),
    'buteth': (8, 2),
    'cbreth': (8, 2),
    'ccceth': (8, 2),
    'cccxeth': (8, 2),
    'citeth': (8, 2),
    'cofieth': (8, 2),
    'cpseth': (8, 2),
    'dageth': (8, 2),
    'datxeth': (8, 2),
    'dcceth': (8, 2),
    'dhteth': (8, 2),
    'drcteth': (8, 2),
    'dscoineth': (8, 2),
    'dtaeth': (8, 2),
    'dwseth': (8, 2),
    'edueth': (8, 2),
    'eeseth': (8, 2),
    'ejoyeth': (8, 2),
    'etcusdt': (2, 4),
    'ethusdt': (2, 4),
    'faireth': (8, 2),
    'fffeth': (8, 2),
    'fieth': (8, 2),
    'fiusdt': (6, 2),
    'fotaeth': (8, 2),
    'freseth': (8, 2),
    'ftbtc': (8, 2),
    'fteth': (8, 2),
    'ftusdt': (6, 2),
    'fueleth': (8, 2),
    'geneeth': (8, 2),
    'grameth': (8, 2),
    'gtceth': (8, 2),
    'guseth': (8, 2),
    'hpceth': (8, 2),
    'icceth': (8, 2),
    'icxeth': (8, 2),
    'ifoodeth': (8, 2),
    'ihteth': (8, 2),
    'iiceth': (8, 2),
    'ionceth': (8, 2),
    'ioveth': (8, 2),
    'latxeth': (8, 2),
    'leteth': (8, 2),
    'ltcusdt': (2, 4),
    'lxteth': (8, 2),
    'mdteth': (8, 2),
    'mesheth': (8, 2),
    'mofeth': (8, 2),
    'msceth': (8, 2),
    'nceth': (8, 2),
    'ngoteth': (8, 2),
    'oaseth': (8, 2),
    'ocneth': (8, 2),
    'omgeth': (6, 4),
    'paieth': (8, 2),
    'pmdeth': (8, 2),
    'pnteth': (8, 2),
    'praeth': (8, 2),
    'rcteth': (8, 2),
    'rnteth': (8, 2),
    'rteeth': (8, 2),
    'sdaeth': (8, 2),
    'seceth': (8, 2),
    'seeeth': (8, 2),
    'sgcceth': (8, 2),
    'showeth': (8, 2),
    'soceth': (8, 2),
    'ssseth': (8, 2),
    'tcteth': (8, 2),
    'tkteth': (8, 2),
    'toseth': (8, 2),
    'tsteth': (8, 2),
    'vcteth': (8, 2),
    'wicceth': (8, 2),
    'wteeth': (8, 2),
    'xmxeth': (8, 2),
    'xpseth': (8, 2),
    'xrpusdt': (4, 2),
    'yeeeth': (8, 2),
    'zileth': (6, 4),
    'zipeth': (8, 2),
    'zipusdt': (6, 2),
    'zrxeth': (6, 2),
    'zsceth': (8, 2),
}

# https://support.fcoin.com/hc/en-us/articles/360003715514-The-Illustration-of-Trading-Fees-and-Order-Rules
min_order_qty = {
    'btcusdt': 0.001,
    'ethusdt': 0.001,
    'bchusdt': 0.001,
    'ltcusdt': 0.001,
    'fteth': 3,
    'zipeth': 200,
    'ftusdt': 3,
    'etcusdt': 0.01,
    'ftbtc': 3,
    'zileth': 10,
    'omgeth': 0.1,
    'icxeth': 0.1,
    'btmusdt': 1,
    'aeeth': 1,
    'zrxeth': 1,
    'bnbusdt': 0.1,
    'xrpusdt': 1,
    'gtcft': 1,
    'zipusdt': 200,
    'fieth': 3,
    'fiusdt': 3,
}

fcoin_order_status_list = [
    'submitted',
    'partial_filled',
    'partial_canceled',
    'filled',
    'canceled',
    'pending_cancel',
]
